package com.fenghongzhang.kuaishou.common;

import com.fenghongzhang.kuaishou.index.home.entity.VideoBean;
import com.fenghongzhang.kuaishou.mvp.login.entity.UserInfoBean;
import com.fenghongzhang.kuaishou.utils.ResponseBean;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * 我的后台接口
 */
public interface ShuaiFengServerApi {
    //注意本地后台地址不能是127.0.0.1,这样会访问到模拟器的地址.
//    String BASE_URL = "http://10.161.3.8:7777"; //本地

    String BASE_URL = "http://www.fenghongzhang.com:7777/"; //远程

    @GET("/video/getAll")
    Observable<ResponseBean<List<VideoBean>>> getAttentBean();


    @POST("/login/in")
    @FormUrlEncoded
    Observable<UserInfoBean> login(@Field("userName")String name, @Field("userPwd") String pwd);

    @POST("/register/new")
    @FormUrlEncoded
    Observable<UserInfoBean> register(@Field("userName")String name, @Field("userPwd") String pwd);
}
